package com.xiaoshuidi.cloud.module.contract.service.contract.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaoshuidi.cloud.module.contract.dal.dataobject.contract.ContractSmsConfigDO;
import com.xiaoshuidi.cloud.module.contract.dal.dataobject.contract.OrderLateFeeVo;
import com.xiaoshuidi.cloud.module.contract.dal.mysql.contract.ContractSmsConfigMapper;
import com.xiaoshuidi.cloud.module.contract.service.contract.ContractSmsConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@Slf4j
public class ContractSmsConfigServiceImpl extends ServiceImpl<ContractSmsConfigMapper, ContractSmsConfigDO> implements ContractSmsConfigService {

    @Resource
    private ContractSmsConfigMapper contractSmsConfigMapper;

    /**
     * 查询
     * @param apartmentId
     * @return
     */
    @Override
    public ContractSmsConfigDO getContractSmsConfig(Long apartmentId) {
        LambdaQueryWrapper<ContractSmsConfigDO> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(ContractSmsConfigDO::getApartmentId,apartmentId);
        ContractSmsConfigDO contractSmsConfigDO = contractSmsConfigMapper.selectOne(wrapper);
        return contractSmsConfigDO;
    }
}
